home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / text / hyper / ADtoHT2_1.lha / Source.lha / MyLib.lha / include / Amiga.h next >
Encoding:
C/C++ Source or Header  |  1995-04-21  |  3.1 KB  |  143 lines

  1. #ifndef _AMIGA_H_
  2. #define _AMIGA_H_
  3.  
  4. #ifndef EXEC_TYPES_H
  5. #include <exec/types.h>
  6. #endif
  7.  
  8. #ifndef WORKBENCH_STARTUP_H
  9. struct WBStartup;
  10. #endif
  11.  
  12. #ifndef DOS_DOSEXTENS_H
  13. struct DosLibrary;
  14. #endif
  15.  
  16. #ifndef EXEC_EXECBASE_H
  17. struct ExecBase;
  18. #endif
  19.  
  20. #ifndef UTILITY_UTILITY_H
  21. struct UtilityBase;
  22. #endif
  23.  
  24. extern struct WBStartup *WorkbenchMessage;
  25. extern struct DosLibrary *DOSBase;
  26. extern struct ExecBase *SysBase;
  27. extern struct UtilityBase *UtilityBase;
  28.  
  29. /************************************************************************/
  30.  
  31. #define RETURN_CATASTROPHY    (100)
  32.  
  33. /************************************************************************/
  34.  
  35. #if defined(__GNUC__)
  36. #  define NORETURN __attribute__((noreturn))
  37. #  define INLINE inline
  38. #  define ALIGN(Variable) Variable __attribute__((aligned(4)))
  39. #  define COMPILER "GNU C " __VERSION__
  40. #  undef CPU
  41. #  if defined(mc68040)
  42. #    define CPU "mc68040"
  43. #  elif defined(mc68030)
  44. #    if defined(__HAVE_68881__)
  45. #      define CPU "mc68ec030/mc68881"
  46. #    else
  47. #      define CPU "mc68ec030"
  48. #    endif
  49. #  elif defined(mc68020)
  50. #    if defined(__HAVE_68881__)
  51. #      define CPU "mc68020/mc68881"
  52. #    else
  53. #      define CPU "mc68020"
  54. #    endif
  55. #  else
  56. #    define CPU "mc68000"
  57. #  endif
  58. #elif defined(__SASC_510)
  59. #  define NORETURN
  60. #  define INLINE
  61. #  define ALIGN(Variable) __aligned Variable
  62. #  define COMPILER "SAS/C 5.10b"
  63. #  define CPU "mc68000"
  64. #else
  65. #  error Compiler not supported.
  66. #endif
  67.  
  68. /************************************************************************/
  69.  
  70. void _geta4(void);
  71.  
  72. /************************************************************************/
  73.  
  74. #ifdef __SASC
  75. #  ifdef SMALL_DATA
  76. #    define __SAVEDS __saveds
  77. #  else
  78. #    define __SAVEDS
  79. #  endif
  80. #endif
  81.  
  82. /************************************************************************/
  83.  
  84. #if defined(__GNUC__)
  85. ULONG MyHookEntry(void);
  86. #elif defined(__SASC)
  87. ULONG __SAVEDS __asm MyHookEntry(register __a0 struct Hook *, register __a2 APTR, register __a1 APTR);
  88. #endif
  89.  
  90. /************************************************************************/
  91.  
  92. ULONG DataPointerToInteger(void *);
  93.  
  94. /*----------------------------------------------------------------------*/
  95.  
  96. #if defined(__GNUC__) && defined(__OPTIMIZE__)
  97.  
  98. extern inline ULONG __inlined_DataPointerToInteger(void *Pointer)
  99. {
  100.   union
  101.     {
  102.       void *Pointer;
  103.       ULONG Integer;
  104.     } t;
  105.  
  106.   t.Pointer=Pointer;
  107.   return t.Integer;
  108. }
  109.  
  110. #define DataPointerToInteger(Pointer) __inlined_DataPointerToInteger(Pointer)
  111. #endif  /* defined(__GNUC__) && defined(__OPTIMIZE__) */
  112.  
  113. /*----------------------------------------------------------------------*/
  114.  
  115. #ifdef __SASC
  116. #define DataPointerToInteger(Pointer) ((ULONG)(Pointer))
  117. #endif
  118.  
  119. /************************************************************************/
  120.  
  121. #if defined(__GNUC__)
  122.  
  123. #define FunctionPointerToDataPointer(Pointer) \
  124.   ({union \
  125.       { \
  126.     void *Data; \
  127.     typeof(Pointer) Function; \
  128.       } __Union; \
  129.     __Union.Function=Pointer; \
  130.     __Union.Data})
  131.  
  132. #elif defined(__SASC)
  133. #define FunctionPointerToDataPointer(Pointer) ((void *)(Pointer))
  134. #endif
  135.  
  136. /************************************************************************/
  137.  
  138. #ifndef MYLIB
  139. #define MYLIB
  140. #endif
  141.  
  142. #endif  /* _AMIGA_H_ */
  143.